
'use strict';
const cloud = require('tcb-admin-node');
const tcbConfig = {env: 'meatom04-01-2gue0fnr49a26808'};
const auth = cloud.init(tcbConfig).auth();
const db = cloud.database();

// 云函数入口函数
exports.main = async (event, context) => {
  let uid = event.uid
  // event
  return db.collection('Operation').add({
    data: event
  })
    .then(res => {
      return true
    })
    .catch(fail => {
      return false
    })
}